import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'

@Component({
  selector: 'eq-console',
  templateUrl: './console.component.html'
})
export class ConsoleComponent implements OnInit {
  title = 'eq-console';

  index: number = 0;

  menuList = [
    {
      index: 0,
      title: '首页',
      link: '/console/home'
    },

    {
      index: 1,
      title: '我的策略',
      link: '/console/algorithm-list'
    },

    {
      index: 2,
      title: '我的交易',
      link: '/console/algorithm-list'
    },

    {
      index: 3,
      title: 'API文档',
      link: '/console/algorithm-list'
    },

    {
      index: 4,
      title: '登录',
      link: '/console/algorithm-list'
    },

    {
      index: 5,
      title: '注册',
      link: '/console/algorithm-list'
    }
  ];

  constructor(
    private router: Router
  ) {}

  ngOnInit() {}

  ngOnActiveLink($event) {
    console.log('handle', $event);
    // this.index = parseInt($event);
    this.router.navigate([this.menuList[$event].link]);
  }
}
